import { request, upload } from "./base"
export default {
  // 根据市场ID查询包装集合
  getPack(tmuId) {
    return request(`trade/packAndMateriel/getAll/${tmuId}`, "get")
  },
  // 删除包装
  deletePack(id) {
    return request(`trade/packAndMateriel/removePackAndMateriel/${id}`, "get")
  },
  // 创建包装及物料
  addPack(data) {
    return request("trade/packAndMateriel/create", "post", data)
  },
  // 修改包装及物料
  editPack(data) {
    return request("trade/packAndMateriel/update", "post", data)
  },
  // 查询市场的物料
  getMateriel(tmuId) {
    return request(`trade/packAndMateriel/materiel/getAll/${tmuId}`, "get")
  },
  // 查询包装详情
  getPackAndMaterielDetail(id) {
    return request(`trade/packAndMateriel/getInfo/${id}`, "get")
  },
  // 修改物料
  editMateriel(data) {
    return request("trade/packAndMateriel/materiel/update", "post", data)
  },
  // 删除物料
  deleteMateriel(id) {
    return request(`trade/packAndMateriel/removeMateriel/${id}`, "get")
  },
  // 创建物料
  addMateriel(data) {
    return request("trade/packAndMateriel/materiel/create", "post", data)
  },
  // 工资管理-未结账分页查询
  getSalaryManagementPage(data) {
    return request("trade/staffManagement/getSalaryManagementPage", "post", data)
  },
  // 已结帐-》小工已结工资订单分页查询
  getSettlementSalaryStatistical(data) {
    return request("trade/staffManagement/getSettlementSalary/statistical", "post", data)
  },
  // 未结账个人工资统计明细
  getSalaryManagementDetail() {
    return request(`trade/staffManagement/getSalaryManagement`, "get")
  },
  // 已结账 -》 单笔结账订单的详情页
  getSettlementBillDetail(billId) {
    return request(`trade/staffManagement/getSettlementBill/detail/${billId}`, "get")
  },
  // 已结帐-》小工已结工资订单统计信息 根据小工用户ID
  getSettlementSalaryByUserId(data) {
    return request("trade/staffManagement/getSettlementSalary/statistical/user", "post", data)
  },
  // 已结账 -》分页查询用户每笔工资记账记录
  getSettlementSalaryPage(data) {
    return request("trade/staffManagement/getSettlementSalaryPage", "post", data)
  },
  // 结账前查询订单包装合计信息
  getPackCounts(data) {
    return request("trade/staffManagement/packCounts", "post", data)
  },
  // 小工结账
  getSettlementSalary(data) {
    return request("trade/staffManagement/settlement/salary", "post", data)
  },
  // 工资管理 【未结账个人用户订单分页查询】
  getNonSettlementOrder(data) {
    return request("trade/staffManagement/getNonSettlementOrder/user", "post", data)
  },
  // 创建账本
  addAccountBook(data) {
    return request("trade/accountBook/create", "post", data)
  },
  // 查询账本(简易)
  getAccountBookEasy() {
    return request("trade/accountBook/queryAccountBook/currentUser", "get")
  },
  // 查询所有账本及账本下信息
  getAccountBook(data) {
    return request("trade/accountBook/page/info", "post", data)
  },
  // 根据id查询账本下信息
  getAccountBookInfo(accountBookId) {
    return request(`trade/accountBook/infoAndStatistics/${accountBookId}`, "get")
  },
  // 分页查询 收入/支出 记录
  getAccountBookRecord(data) {
    return request("trade/accountBook/page/record", "post", data)
  },
  // 创建收入/支出 记录
  addAccountBookRecord(data) {
    return request("trade/accountBook/create/record", "post", data)
  },
  // 修改收入/支出 记录
  editAccountBookRecord(data) {
    return request("trade/accountBook/modify/record", "post", data)
  },
  // 获取财务类型列表
  getFinanceTypeList(data) {
    return request("assist/financeType/selectFinanceTypeList", "post", data)
  },
  // 设备绑定公司(直接关联公司层)
  addBindDevice(data) {
    // snNumber
    // companyId
    return request("plot/facilityBind/bindCompany", "post", data)
  },
  // 设备列表分页查询
  getListFacilitiesByCondition(data) {
    // companyId
    // firstTheDeviceId 15
    // secondTheDeviceId 83-地磅 84-打印机
    return request("device/facility/page", "post", data)
  },
  // 修改账本（和关闭账本是同一个）
  editAccountBook(data) {
    // status账本状态 2->正在使用，3->关闭账本
    return request("trade/accountBook/modify", "post", data)
  },
  // 删除账本
  deleteAccountBook(bookId) {
    return request(`trade/accountBook/remove/book/${bookId}`, "get")
  },
  // 根据收入支出记录ID 查询 收入/支出 记录
  getAccountBookRecordInfo(id) {
    return request(`trade/accountBook/query/record/${id}`, "get")
  },
  // 打印小票
  getPrint(id) {
    return request(`trade/accountBook/query/record/${id}`, "get")
  }
}
